package com.njtoyo.taxi.admin.mapper.master.entity;

import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.njtoyo.taxi.admin.rest.wrapper.open.privacy_number.FinishWrapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 隐私通话记录
 * </p>
 *
 * @author Dell
 * @since 2021-11-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="DialRecord对象", description="隐私通话记录")
@Accessors(chain = true)
public class DialRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "绑定关系id")
    private Long callRelevanceId;

    @ApiModelProperty(value = "呼叫记录的唯一标识")
    private String icid;

    @ApiModelProperty(value = "详细信息")
    private String detail;

    @ApiModelProperty(value = "华为云录音文件地址")
    private String huaweiUrl;

    @ApiModelProperty(value = "七牛云录音文件地址")
    private String qiniuUrl;

    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;

    public FinishWrapper getDetailToObject() {
        return JSONUtil.toBean(detail, FinishWrapper.class);
    }

    public void setDetail(FinishWrapper detail) {
        this.detail = JSONUtil.toJsonStr(detail);
    }
    
    public void setDetail(String detail) {
        this.detail = detail;
    }
}
